﻿@model Enum  
@{
    string name = ViewData.TemplateInfo.HtmlFieldPrefix;
    var list = Enum.GetValues(Model.GetType()) .Cast<Enum>() .Select(m => { int enumVal = Convert.ToInt32(m); 
        return new SelectListItem()
        {
            Selected = (Convert.ToInt32(Model) == enumVal),
            Text = m.ToString(),
            Value = enumVal.ToString()
        };
    });
}
@foreach (var item in list)
{ 
    <input type="checkbox" name="@name" id="@(name + item.Value)" value="@item.Value" /><label for="@(name + item.Value)">@item.Text</label>
}